package com.liuugoqing.creator.factory.simple;

/**
 * 咖啡店，调用咖啡工厂获取咖啡
 * @Author : liugq
 * @Date : 2022/6/30 11:37
 * @See : 参考类
 * @Since： JDK1.8
 * @Version : 1.0
 */
public class CoffeeStore {
    public Coffee orderCoffee(String type){
        //通过工厂获取咖啡
        SimpleCoffeeFactory factory = new SimpleCoffeeFactory();
        Coffee coffee = factory.createCoffee(type);
        //加工
        coffee.addMilk();;
        coffee.addSugar();
        return coffee;
    }
}
